﻿///<reference path="jquery-1.4.3.min.js" />
///<reference path="kooboo.js" />
///<reference path="kooboo.webcontrols.js" />

function __initDropdownlist(ui, defautValues,id) {
    kooboo.webcontrols[ui] = {
        val: function (value) {
            if (value == undefined) {
                return $("#" + ui).val();
            } else {

                $("#" + ui + " option").each(function (index, item) {
                    $item = $(item);
                    $item.attr("selected", $item.val() == value);
                });
            }
        },
        html: function (html) {
            this.val(html);
        },
        reset: function () {
            this.val(defautValues);
        },
        id: id
    };
}